﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace COSIX.Commands
{
    class CommandManager
    {
        public List<CommandBase> Commands = new List<CommandBase>();

        public void Init()
        {
            Commands.Add(new COSIX.Commands.Commands.HelpCommand());
        }

        public void Run(string cmd, string args = "")
        {
            bool g = false;
            for (int i = 0; i < Commands.Count - 1; i++)
            {
                Console.WriteLine("commandname: " + Commands[i].CommandName);
                Console.WriteLine("cmd: " + cmd);
                if (Commands[i].CommandName.ToLower() == cmd.ToLower())
                {
                    Commands[i].Run(args);
                    g = true;
                }
            }
            /*if (!g)
            {
                Console.WriteLine("*** FUCKING COSMOS HAS DECIDED TO NOT DO THIS CODE ***");
            }*/
        }
    }
}
